<template>
  <div class="Main">
    <el-container class="out-container">
      <el-aside :width="isCollapse ? '60px' : '170px'">
        <nav-menu :collapse="isCollapse" />
      </el-aside>
      <el-container>
        <el-header class="header">
          <NavHeader @foldChange="handleFoldChange" />
        </el-header>
        <el-main class="main">
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import NavMenu from '@/components/NavMenu/NavMemu.vue'
import NavHeader from '@/components/NavHeader/NavHeader.vue'
export default defineComponent({
  components: {
    NavMenu,
    NavHeader
  },
  setup() {
    const isCollapse = ref(false)
    const handleFoldChange = (isFold: boolean) => {
      isCollapse.value = isFold
    }
    return { isCollapse, handleFoldChange }
  }
})
</script>

<style scoped lang="less">
.Main {
  height: 100%;
  width: 100%;
  .out-container {
    height: 100%;
  }
  .header {
    height: 50px;
  }
  .main {
    height: calc(100%-50px);
  }
}
.el-aside {
  overflow-x: hidden;
  overflow-y: auto;
  line-height: 200px;
  text-align: left;
  background-color: #001529;
  transition: width 0.3s linear;
  scrollbar-width: none; /* firefox */
  -ms-overflow-style: none; /* IE 10+ */

  &::-webkit-scrollbar {
    display: none;
  }
}
.el-main {
  color: #333;
  text-align: center;
  background-color: #f0f2f5;
}
</style>
